package cn.edu.sicau.databasepp.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "lend_room_action", schema = "sqlexcise", catalog = "")
public class LendRoomActionEntity
{
    private Timestamp start;
    private Timestamp end;
    private Byte assgined;
    private String lendRoomId;

    @Basic
    @Column(name = "start", nullable = true)
    public Timestamp getStart()
    {
        return start;
    }

    public void setStart(Timestamp start)
    {
        this.start = start;
    }

    @Basic
    @Column(name = "end", nullable = true)
    public Timestamp getEnd()
    {
        return end;
    }

    public void setEnd(Timestamp end)
    {
        this.end = end;
    }

    @Basic
    @Column(name = "assgined", nullable = true)
    public Byte getAssgined()
    {
        return assgined;
    }

    public void setAssgined(Byte assgined)
    {
        this.assgined = assgined;
    }

    @Id
    @Column(name = "lend_room_id", nullable = false, length = 32)
    public String getLendRoomId()
    {
        return lendRoomId;
    }

    public void setLendRoomId(String lendRoomId)
    {
        this.lendRoomId = lendRoomId;
    }

    @Override
    public boolean equals(Object o)
    {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LendRoomActionEntity that = (LendRoomActionEntity) o;
        return Objects.equals(start, that.start) &&
                Objects.equals(end, that.end) &&
                Objects.equals(assgined, that.assgined) &&
                Objects.equals(lendRoomId, that.lendRoomId);
    }

    @Override
    public int hashCode()
    {
        return Objects.hash(start, end, assgined, lendRoomId);
    }
}
